<?php

namespace App\Http\Controllers\Home;

use App\Models\Message;
use Illuminate\Support\Facades\View;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CommonController extends Controller
{

    /**
     * 初始化数据
     * CommonController constructor.
     */
    public function __construct()
    {
        $new = Message::orderBy('created_at', 'DESC')->take(10)->get();
        View::share('new', $new);
    }

}
